import store from "../store/idnex.js";
import cryptoJs from "../utils/encryptDES.js";
import {
	requestkey
} from "./requestkey.js";
let getInfo = () => {
	let encrypted = ""
	// encrypted = cryptoJs.encryptMD5(uni.getAccountInfoSync().miniProgram.appId)
	encrypted = cryptoJs.encryptMD5(store.state.appid)
	uni.getSystemInfo({
		success: function(res) {
			console.log(res.osName, "系统")
			let baseinfopro = {
				userid: "",
				ap: "wifi",
				deviceid: "F85D3CF4EFF179A1AB4B069DB28F67B6",
				ua: res.model,
				sid: "",
				version: res.system,
				osid:'douyin',
				df: res.brand,
				lg: "zh_hans",
				appId: store.state.appid,
				sha1: encrypted,
				apiVersion: "4"
			};
			uni.setStorageSync("baseinfopro", baseinfopro); //设置缓存
			uni.setStorageSync("OS", res.osName);
			requestkey();
		},
	});
}
export {
	getInfo
};